home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
015
/
hpstuff.arc
/
HPSTUFF.DOC
< prev
next >
Wrap
Text File
|
1987-02-27
|
6KB
|
125 lines
HP LaserJet Tools
Rip Toren
POB 674
Columbia MD 21045
This is a collection of programs that have developed over time to assist
in working with the HP LaserJet printer. My HPLJ has no font cartridges,
and I quickly learened it could not do the PC line drawing symbols.
HPFILTER
This is a TSR (terminate and stay resident) program that I use to produce
line drawing characters on my printer that does not have any FONT
cartridges. It is tied into the interrupt to the printer (17). It looks
for ASCII codes 179 through 223. When these are found, a command string
is sent to the HPLJ to produce those line grawing characters. It will
also BOLD (fatten) characters between an ESC 'G' and ESC 'H'. ESC 'G will
start it, while ESC'H' or ESC'E' will terminate it. It will definitely
screw up any output to anything other that the HPLJ if these characters
are sent. To turn off the filtering, simply run it a second time.
>HPFILTER
HPXFER
While trying to develop the strings that HPFILTER would use, it became
apparent that it was a pain to modify and rec assemble. This drove the
development of HPXFER.
This program will read in a standard Ascii file and send part of it to
the printer. The file name is the only argument. If it is not found, the
extension '.HPX' will be appended, and the open tried again. The data
found on each line is sent until a tilde ('~') is located. Every thing
following the tilde is treated as comment. If the end of the line is
found without finding a tilde, the CRLF is also sent to the printer.
If a line is read that starts with '@' in character 1, the rest is
assumed to be a file name. That file is opened in BINARY mode, and its
entire content is sent to the printer. This is usually a bit graphic
image.
>HPXFER LOGOSET.HPX
** WARNING ** It is generally a bad idea to send binary data to the
printer while HPFILTER is active. It will garble (transl-
ate) any binary values that fall within its range.
Probably with very poor results.
CPAINT
Now that there is a way to send single command lines, and binary files,
all that is needed is a way to obtain those binary files. CPAINT (See
PAINT) is one way to do that. CPAINT will read a PC Paintbrush
(Zsoft/Microsoft) file (PCX or PCC) and produce up to four data files.
Each data file corresponds to one level or plane in the image. They are
usually RED, GREEN, BLUE, and INTENSITY. Each output file starts with
the HPLJ code to begin graphics ('ESC *r1A'), with the current cursor
location as the left margin. The file ends with an end of graphic code
('ESC *rB'). Each graphic line is also setup with the proper HPLJ code
for the number of bytes of binary data.
The program does one special thing. As it is scanning the input, it does
not transfer any data to the output files until a scan line has been
located that contain a set bit. This means that your resulting file will
not contain white space above the image. You position the cursor prior
to printing for exact registration.
>CPAINT RTLOGO.PCX YNNN
Since the amount of information is rather massive that can be produced, a
second argument is checked for flags. This argument will allow you to
suppress the production of any of the planes. The output files are named
"PLANEx.DAT" where 'x' is a number 1 through 8. If you wish to produce
only planes 2 & 3, the second argument would by "NYYN". This says '(N)o'
to planes 1 & 4, and '(Y)es' to planes 2 & 3. When using an EGA adaptor,
you currently get only 4 planes, so you needn't worry about the last
four. Only enough data file are use to cover the number of planes in the
file.
If you draw your image in Black lines on a White background, you will
find that all four planes conatin the same pattern. If you use patterns,
are different colors, you may find data in some planes, and not in
others.
READY - SET - GO
Draw your image using PC Paintbrush. Crop, cut and save only the part you
want to appear on the page. Run CPAINT to extract the planes you want to
print. Build the rest of the commands that you want for positioning and
line drawing, as well as any included image files into a an Ascii file.
Run HPXFER to send that file to your HPLJ. Ta-Da. If the lines look OK,
but the image is real trash, check to insure that HPFILTER is de-
activated or not installed at all.
NOTES
HPFILTER was originally designed to work with WordPerfect 4.1. I have
been using it now for 3 months with no problems. I have my HPLJ attached
to LPT1. I had to create my own character definition using the "PRINTER"
program supplied with WP 4.1. I copied one of the character sets into my
own name, the modified it to send the simpla Ascii for characters 179
through 223. I also was able to obtain "BOLD" ouput by doing it on a
second pass, and having the start string offset the printer cursor up and
over one dot. At the end of the pass, the cursor is offset back and down
one dot.